import axios from 'axios';

/**
 * 获取用户列表
 */
export function getUsersList(payload: any) {
    return axios.post('/api/v1/cloudUser/list', payload);
}

/**
 * 新建用户
 */
export function createUserInfo(payload: any) {
    return axios.post('/api/v1/cloudUser/add', payload);
}

/**
 * 新建用户
 */
export function editUserInfo(payload: any) {
    return axios.post('/api/v1/cloudUser/edit', payload);
}

/**
 * 新建用户
 */
export function deleteUserInfo(payload: any) {
    return axios.post('/api/v1/cloudUser/delete', payload);
}
/**
 * 获取权限列表
 */
export function getPermission(payload: any) {
    return axios.post('/api/v1/menu/tree', payload);
}

/**
 * 用户已有权限
 */
export function getUserPermission(payload: any) {
    return axios.post('/api/v1/cloudUser/userMenus', payload);
}

/**
 * 保存用户权限
 */
export function editUserPermission(payload: any) {
    return axios.post('/api/v1/cloudUser/grant', payload);
}
